1. Technical Field of the Invention
The present invention relates to a method for calibration of an oscillator for a microcontroller chip operation.
2. Description of Related Art
Most computer systems today require various clock sources for the operation of different components in the system. Common clock sources use oscillators such as quartz and RC oscillators which are usually external to the system using the clock signal. More recently, several devices have started incorporating internal clock sources as this reduces the complexity of the chip by reducing the need for external pins and also reduces the need for the clock recovery circuitry. Quartz oscillators, although precise, are very expensive and hence are highly undesirable in mass usage applications requiring relatively low clock frequencies, e.g. 2-5 MHz. As most of the time, such systems are implemented on microcontrollers, there is a need of cheap and reliable clock sources for such microcontrollers.
The cheapest clocking method, for the applications requiring low clock frequencies, is to use internal RC oscillators as a clock source. RC oscillators are very cheap in comparison to the crystal oscillators and are normally built into the microcontrollers. Using internal RC oscillator reduces the cost in the mass production of electronic devices. However, the low cost RC oscillators have a few disadvantages in terms of reliability and speed. The frequency of the clock signal delivered by the RC oscillator is highly dependent on the operating environment, particularly on the temperature. The clock frequency variation also depends on the circuit design and the manufacturing process variations. In addition to this, an RC oscillator cannot be used for devices using high-speed clocks as the values of R and C have to be nominal to prevent excessive power loss and noise.
There are several calibration methods available for minimizing the frequency range variations in the RC oscillators. All these existing calibration methods/architecture use an external signal for a reference frequency. Reference is made to European Application 02291700.9 entitled “Method of Operating a Microcontroller Chip Having an Internal RC Oscillator and Microcontroller Chip Embodying the Method” which describes a calibration method and system with an RC oscillator using an external calibration clock source for capturing the reference frequency. The calibration ratio/values are derived based on the comparison of the RC oscillator clock frequency and the reference frequency. The calibration ratio/value is provided along with the uncalibrated clock to various blocks for performing different tasks. Hence, instead of altering the clock of the RC oscillator, the blocks are given the uncalibrated clock and the tasks are performed based on the calibration ratio/value.
The foregoing method/system has several disadvantages. In this method/system, the actual parameters of the reference signal are compared with the parameters calculated by the microcontroller. Hence, the methodology/architecture results in excessive burden in mass production of the chip as the reference signal has to be provided to every device for the calibration. Also the calibration factor/value has to be stored in the non-volatile memory location to get the calibrated clock after each power down. Absence of non-volatile memories in the controller would result in a need to recalibrate the clock with a reference signal every time the microcontroller is powered up. Also, if the memory of the device is erased/reprogrammed, the same recalibration procedure must be followed. Also, additional blocks are required in the peripheral devices for the acquisition of a clock signal with the reference signal frequency. There is also additional computational burden on the controller in calculating and using the calibration ratio.
Hence, there is need for a method for reliable calibration of low cost oscillators in microcontrollers. There is also need of method and system for calibration which reduces the requirement of additional blocks for clock generation. Furthermore, there is need for calibration technique which does not require an external reference signal.